#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : RAG-demo
# @File    : text_splitter_util.py
# @IDE     : PyCharm
# @Author  :ZH
# @Time    : 2025/6/30 15:31
from langchain.text_splitter import RecursiveCharacterTextSplitter


def easy_split_content(content: str, chunk_size: int = 512, chunk_overlap: int = 100) -> list:
    """
    将内容分割成多个块
    :param content: 要分割的内容
    :param chunk_size: 每个块的大小
    :param chunk_overlap: 块之间的重叠大小
    :return: 分割后的内容列表
    """
    text_splitter = RecursiveCharacterTextSplitter(
        chunk_size=chunk_size,
        chunk_overlap=chunk_overlap
    )
    return text_splitter.split_text(content)


